package Array;

public class item27 {
    public static int removeElement(int[] nums, int val) {
        int len = nums.length;
        int count = 0;
        int left = 0;
        for(int right= 0 ;right<len;right++)
        {
            if(nums[right]!=val)
            {
                int temp = nums[right];
                nums[right] = nums[left];
                nums[left] =temp;
                count++;
            }
        }
        return count;
    }

    public static void main(String[] args) {
        int[] nums = {3,2,2,3};
        removeElement(nums, 3);
    }
}
